#! /bin/bash
# 获取脚本执行目录
shDir=$(cd `dirname $0`; pwd)
exUri=${shDir}
cd ${shDir}

# 变量声明
. ../func/const.sh
. ../func/file.sh

echo -e '\e[36m初始化目录\e[0m'

# 目录结构
# 数据根目录/usrdata
# - desktop
# - dl
# - 其他库目录

# 创建用户文件夹
mkdir -p "${uzerLink}/desktop"
mkdir -p "${tmpDir}/wget"
mkdir -p "${publicDir}"
mkdir -p "${srvDir}"
# 链接库目录
ln -sf "${libDir}/doc" "${uzerLink}/doc"
ln -sf "${libDir}/pic" "${uzerLink}/pic"
ln -sf "${libDir}/audio" "${uzerLink}/audio"
ln -sf "${libDir}/video" "${uzerLink}/video"
ln -sf "${publicDir}" "${uzerLink}/public"
ln -sf "${tmpDir}/wget" "${uzerLink}/dl"
ln -sf "${appDir}" "${uzerLink}/app"

# 移动家目录到数据持久化目录
mkFileOld "${homeDir}"
mv "/home/${uzerName}" "${homeDir}"
ln -sf "${homeDir}" "/home/${uzerName}"

# 将usrdata链接到家目录
ln -sf "${uzerLink}" "~/usrdata"
